SlideShare a Scribd company logo
1 of 41
Yahoo!Kimo  YUI 3: Design and Architecture  Thomas S. Sha YUI  developer.yahoo.com/yui/
YUI Evolved Faster, Lighter, Smarter
YUI Evolved Architecture, Lifecycle, Packaging
From YAHOO to YUI() ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
From YAHOO to YUI() YUI().use(“io-base”, function (Y) { var request  = Y.io( ); });
Self-Completing ,[object Object],[object Object],[object Object],[object Object]
Protected ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Protected, again ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Self-Populating ,[object Object],[object Object],[object Object],[object Object],[object Object]
Reconciling Dependencies ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Yahoo! CDN and Combo-Handling ,[object Object]
From Module to Sub-Module ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],YUI().use("io-base", function(Y){ }) YUI().use("io-xdr", function(Y){ }) YUI().use("io", function(Y){ })
YUI IO – Size Analysis
Plug-Ins and Extensions ,[object Object],Overlay Tooltip myOverlay Positioning Adv. Positioning Shimming/Stacking Header/Body/Footer Animation IO Binding
Extensions: Class-based Flexibility Create an Overlay Class Y.Overlay = Y.Base.build("overlay", Y.Widget, [ Widget-Position,  // Positioning Widget-Position-Ext,  // Adv. Positioning Widget-Stack,  // Shim/Stack Support Widget-StdMod  // Header/Body/Footer ]);
Extensions: Reuse Reuse only the extensions desired for Tooltip Y.Tooltip = Y.Base.build("tooltip", Y.Widget, [ Widget-Position,  // Positioning Widget-Stack  // Shim/Stack Support ]);
Plug-in: Instance-based Flexibility Instance of Overlay, adding io support var ioOverlay = new Y.Overlay(...); ioOverlay.plug(Y.OverlayIOPlugin, { url: "http://host.foo.com/getOverlayContent" }); ioOverlay.io.refreshContent();
Plug-in: Instance-based Override Instance of Overlay, adding Animation Support var animOverlay = new Y.Overlay(...); animOverlay.plug(Y.WidgetAnimPlugin); animOverlay.show(); animOverlay.hide();
[object Object],[object Object],[object Object],[object Object],[object Object],The enhanced Custom Event system is an integral part of YUI 3.  Its goal is to be as lightweight as possible, allowing for highly decoupled code. Custom Events
Event Façades // DOM Event linkNode.on(&quot;click&quot;, function(e) { if (!e.target.hasClass(&quot;selector&quot;)) { e.preventDefault(); } }); // Custom Event slider.on(&quot;valueChange&quot;, function(e) { if (e.newVal < 200) { e.preventDefault(); } });
Event Aspect in YUI 2 // Publisher show : function() { if (this.fire(&quot;beforeShow&quot;)) { YAHOO.util.Dom.removeClass(node, &quot;hidden&quot;); this.fire(&quot;show&quot;); } } // Subscriber overlay.subscribe(&quot;beforeShow&quot;, function(t, args) { if (!taskSelected) { return false; } } overlay.subscribe(&quot;show&quot;, function(t, args) {...});
Event Aspect in YUI 3 // Publisher show : function() { this.fire(&quot;show&quot;); } _defaultShowFunction : function(e) { node.removeClass(&quot;hidden&quot;); } // Subscriber overlay.on(&quot;show&quot;, function(e) { if (!taskSelected) { e.preventDefault(); } } overlay.after(&quot;show&quot;, function(e) { });
Event Flow: On -> Default -> After ON ON Default Behavior After After After this.fire(&quot;select&quot;); e.stopImmediatePropagation() e.preventDefault() e.preventDefault() e.stopImmediatePropagation()
Bubbling: Delegation Beyond the DOM Menu.prototype = { addItem : function(menuItem) { var menu = this; menuItem.addTarget(menu); }, initializer : function() { this.on(&quot;menuitem:select&quot;, this._itemSelect); } } menu.getItem(2).on(&quot;select&quot;, function(e) { // Handle select for item 2, don’t bubble to Menu e.stopPropagation(); ... } Event Bubbling: Delegation Beyond the DOM
Event Flow : Bubbling Menu MenuItem ON ON Default After After After this.fire(&quot;menuitem:select&quot;); ON Default After After e.stopPropagation()
// YUI 2 overlay.on(&quot;show&quot;, myShowHandler, myApp, true); overlay.unsubscribe(&quot;show&quot;, myShowHandler, myApp); // YUI 3 var handle = overlay.on(&quot;show&quot;, myShowHandler, myApp, true); handle.detach(); // Or overlay.on(&quot;myApp:show&quot;, myShowHandler, myApp, true); overlay.on(&quot;myApp:hide&quot;, myHideHandler, myApp, true); overlay.detach(&quot;myApp:show&quot;); overlay.detach(&quot;myApp:*&quot;); Detaching Event Listeners
[object Object],[object Object],[object Object],[object Object],[object Object],A single convenient API for working with HTML Elements. Node: The Ideal Element
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Working with HTML Elements in YUI 2
[object Object],[object Object],[object Object],Y.Node.get(…).addClass(&quot;current&quot;).on(&quot;click&quot;,handler); Working with HTML Elements in YUI 3
[object Object],[object Object],[object Object],[object Object],[object Object],Supports the HTMLElement API
Normalizes the HTMLElement API ,[object Object],[object Object],[object Object],[object Object],[object Object]
Enhances The HTMLElement API ,[object Object],[object Object],[object Object],[object Object]
Reacting to Property Changes in Node ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Remember the Extensibility of Plug-Ins ,[object Object],[object Object],[object Object],[object Object],[object Object]
Node is the single point for DOM access, throughout YUI 3. Makes YUI 3 ideal as a trusted source in protected environments such as Caja and Ad-Safe. Constrained by Façades
var items = Y.Node.all(&quot;.actions li&quot;); items.addClass(&quot;disabled&quot;); items.set(&quot;title&quot;, &quot;Item Disabled&quot;); items.each(function(node) { node.addClass(&quot;disabled); node.set(&quot;title&quot;, &quot;Item Disabled&quot;); }); NodeList: Operations a on Node Collection
Core Language Conveniences ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A Common Component Foundation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A Common Component Foundation ,[object Object],[object Object],[object Object],[object Object],[object Object]
A Common Component Foundation ,[object Object],[object Object],[object Object],[object Object],[object Object]
For More Information ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

Introducing YUI 3 AutoComplete
Introducing YUI 3 AutoCompleteIntroducing YUI 3 AutoComplete
Introducing YUI 3 AutoCompleteRyan Grove
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4Javier Eguiluz
 
Curso Symfony - Clase 2
Curso Symfony - Clase 2Curso Symfony - Clase 2
Curso Symfony - Clase 2Javier Eguiluz
 
Matching Game In Java
Matching Game In JavaMatching Game In Java
Matching Game In Javacmkandemir
 
2010 bb dev con
2010 bb dev con 2010 bb dev con
2010 bb dev con Eing Ong
 
How I started to love design patterns
How I started to love design patternsHow I started to love design patterns
How I started to love design patternsSamuel ROZE
 
Symfony Messenger (Symfony Live San Francisco)
Symfony Messenger (Symfony Live San Francisco)Symfony Messenger (Symfony Live San Francisco)
Symfony Messenger (Symfony Live San Francisco)Samuel ROZE
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说Ting Lv
 
Arquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga EscalaArquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga EscalaEduardo Shiota Yasuda
 
Sylius and Api Platform The story of integration
Sylius and Api Platform The story of integrationSylius and Api Platform The story of integration
Sylius and Api Platform The story of integrationŁukasz Chruściel
 
Cooking with jQuery @ OSCON 2010
Cooking with jQuery @ OSCON 2010Cooking with jQuery @ OSCON 2010
Cooking with jQuery @ OSCON 2010appendTo
 
Non Conventional Android Programming En
Non Conventional Android Programming EnNon Conventional Android Programming En
Non Conventional Android Programming Enguest9bcef2f
 

What's hot (19)

Introducing YUI 3 AutoComplete
Introducing YUI 3 AutoCompleteIntroducing YUI 3 AutoComplete
Introducing YUI 3 AutoComplete
 
jQuery: Events, Animation, Ajax
jQuery: Events, Animation, AjaxjQuery: Events, Animation, Ajax
jQuery: Events, Animation, Ajax
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4
 
Advance jquery-plugin
Advance jquery-pluginAdvance jquery-plugin
Advance jquery-plugin
 
Con5623 pdf 5623_001
Con5623 pdf 5623_001Con5623 pdf 5623_001
Con5623 pdf 5623_001
 
Curso Symfony - Clase 2
Curso Symfony - Clase 2Curso Symfony - Clase 2
Curso Symfony - Clase 2
 
Matching Game In Java
Matching Game In JavaMatching Game In Java
Matching Game In Java
 
2010 bb dev con
2010 bb dev con 2010 bb dev con
2010 bb dev con
 
How I started to love design patterns
How I started to love design patternsHow I started to love design patterns
How I started to love design patterns
 
Symfony Messenger (Symfony Live San Francisco)
Symfony Messenger (Symfony Live San Francisco)Symfony Messenger (Symfony Live San Francisco)
Symfony Messenger (Symfony Live San Francisco)
 
Unit Test Fun
Unit Test FunUnit Test Fun
Unit Test Fun
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说
 
Arquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga EscalaArquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga Escala
 
Modular and Event-Driven JavaScript
Modular and Event-Driven JavaScriptModular and Event-Driven JavaScript
Modular and Event-Driven JavaScript
 
Sylius and Api Platform The story of integration
Sylius and Api Platform The story of integrationSylius and Api Platform The story of integration
Sylius and Api Platform The story of integration
 
Cooking with jQuery @ OSCON 2010
Cooking with jQuery @ OSCON 2010Cooking with jQuery @ OSCON 2010
Cooking with jQuery @ OSCON 2010
 
Cooking with jQuery
Cooking with jQueryCooking with jQuery
Cooking with jQuery
 
iOS
iOSiOS
iOS
 
Non Conventional Android Programming En
Non Conventional Android Programming EnNon Conventional Android Programming En
Non Conventional Android Programming En
 

Viewers also liked

Tw Mail Open Hack Day 2
Tw Mail Open Hack Day 2Tw Mail Open Hack Day 2
Tw Mail Open Hack Day 2JH Lee
 
K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017
K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017
K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017JH Lee
 
Search Monkey
Search MonkeySearch Monkey
Search MonkeyJH Lee
 
C A S Sample Php
C A S Sample PhpC A S Sample Php
C A S Sample PhpJH Lee
 
Tw Mail Open Hack Day 1
Tw Mail Open Hack Day 1Tw Mail Open Hack Day 1
Tw Mail Open Hack Day 1JH Lee
 
Y Boss External 20091017
Y Boss External 20091017Y Boss External 20091017
Y Boss External 20091017JH Lee
 

Viewers also liked (6)

Tw Mail Open Hack Day 2
Tw Mail Open Hack Day 2Tw Mail Open Hack Day 2
Tw Mail Open Hack Day 2
 
K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017
K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017
K+ Open Api For 2009 Yahoo! Open Hack Day By Sc@20091017
 
Search Monkey
Search MonkeySearch Monkey
Search Monkey
 
C A S Sample Php
C A S Sample PhpC A S Sample Php
C A S Sample Php
 
Tw Mail Open Hack Day 1
Tw Mail Open Hack Day 1Tw Mail Open Hack Day 1
Tw Mail Open Hack Day 1
 
Y Boss External 20091017
Y Boss External 20091017Y Boss External 20091017
Y Boss External 20091017
 

Similar to 2009 Hackday Taiwan Yui

Embracing YUI3 and Frontend Perf
Embracing YUI3 and Frontend PerfEmbracing YUI3 and Frontend Perf
Embracing YUI3 and Frontend PerfMorgan Cheng
 
YDN KR Tech Talk : YUI 3.0
YDN KR Tech Talk : YUI 3.0YDN KR Tech Talk : YUI 3.0
YDN KR Tech Talk : YUI 3.0Jinho Jung
 
What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.Mark Rees
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery ApplicationsRebecca Murphey
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best PracticesYekmer Simsek
 
J Query Presentation
J Query PresentationJ Query Presentation
J Query PresentationVishal Kumar
 
Javascript essential-pattern
Javascript essential-patternJavascript essential-pattern
Javascript essential-pattern偉格 高
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to javaciklum_ods
 
jQuery Performance Rules
jQuery Performance RulesjQuery Performance Rules
jQuery Performance Rulesnagarajhubli
 
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)
J2ME Lwuit, Storage & Connections (Ft   Prasanjit Dey)J2ME Lwuit, Storage & Connections (Ft   Prasanjit Dey)
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)Fafadia Tech
 
Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Davide Cerbo
 
Roundarch Isobar Java script coding standards
Roundarch Isobar Java script coding standardsRoundarch Isobar Java script coding standards
Roundarch Isobar Java script coding standardsyoav-netcraft
 
XML-Free Programming
XML-Free ProgrammingXML-Free Programming
XML-Free ProgrammingStephen Chin
 
Client-side JavaScript Vulnerabilities
Client-side JavaScript VulnerabilitiesClient-side JavaScript Vulnerabilities
Client-side JavaScript VulnerabilitiesOry Segal
 

Similar to 2009 Hackday Taiwan Yui (20)

Embracing YUI3 and Frontend Perf
Embracing YUI3 and Frontend PerfEmbracing YUI3 and Frontend Perf
Embracing YUI3 and Frontend Perf
 
YDN KR Tech Talk : YUI 3.0
YDN KR Tech Talk : YUI 3.0YDN KR Tech Talk : YUI 3.0
YDN KR Tech Talk : YUI 3.0
 
Dojo and Adobe AIR
Dojo and Adobe AIRDojo and Adobe AIR
Dojo and Adobe AIR
 
What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery Applications
 
Clipboard support on Y! mail
Clipboard support on Y! mailClipboard support on Y! mail
Clipboard support on Y! mail
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
 
jQuery for web development
jQuery for web developmentjQuery for web development
jQuery for web development
 
J Query Presentation
J Query PresentationJ Query Presentation
J Query Presentation
 
Javascript essential-pattern
Javascript essential-patternJavascript essential-pattern
Javascript essential-pattern
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 
jQuery Performance Rules
jQuery Performance RulesjQuery Performance Rules
jQuery Performance Rules
 
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)
J2ME Lwuit, Storage & Connections (Ft   Prasanjit Dey)J2ME Lwuit, Storage & Connections (Ft   Prasanjit Dey)
J2ME Lwuit, Storage & Connections (Ft Prasanjit Dey)
 
Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)
 
Roundarch Isobar Java script coding standards
Roundarch Isobar Java script coding standardsRoundarch Isobar Java script coding standards
Roundarch Isobar Java script coding standards
 
XML-Free Programming
XML-Free ProgrammingXML-Free Programming
XML-Free Programming
 
Client-side JavaScript Vulnerabilities
Client-side JavaScript VulnerabilitiesClient-side JavaScript Vulnerabilities
Client-side JavaScript Vulnerabilities
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 
jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
 

More from JH Lee

Cas Open Api 2009 Hack Day
Cas Open Api 2009 Hack DayCas Open Api 2009 Hack Day
Cas Open Api 2009 Hack DayJH Lee
 
2009 Tw Oh Wretch Api
2009 Tw Oh Wretch Api2009 Tw Oh Wretch Api
2009 Tw Oh Wretch ApiJH Lee
 
Yql V8
Yql V8Yql V8
Yql V8JH Lee
 
Erikeldridge Yos V9
Erikeldridge Yos V9Erikeldridge Yos V9
Erikeldridge Yos V9JH Lee
 
TWOHD_Search Monkey
TWOHD_Search MonkeyTWOHD_Search Monkey
TWOHD_Search MonkeyJH Lee
 
TWOHD_Wretch API
TWOHD_Wretch APITWOHD_Wretch API
TWOHD_Wretch APIJH Lee
 
TWOHD_K+ API
TWOHD_K+ APITWOHD_K+ API
TWOHD_K+ APIJH Lee
 
TWOHD_Blueprint
TWOHD_BlueprintTWOHD_Blueprint
TWOHD_BlueprintJH Lee
 

More from JH Lee (8)

Cas Open Api 2009 Hack Day
Cas Open Api 2009 Hack DayCas Open Api 2009 Hack Day
Cas Open Api 2009 Hack Day
 
2009 Tw Oh Wretch Api
2009 Tw Oh Wretch Api2009 Tw Oh Wretch Api
2009 Tw Oh Wretch Api
 
Yql V8
Yql V8Yql V8
Yql V8
 
Erikeldridge Yos V9
Erikeldridge Yos V9Erikeldridge Yos V9
Erikeldridge Yos V9
 
TWOHD_Search Monkey
TWOHD_Search MonkeyTWOHD_Search Monkey
TWOHD_Search Monkey
 
TWOHD_Wretch API
TWOHD_Wretch APITWOHD_Wretch API
TWOHD_Wretch API
 
TWOHD_K+ API
TWOHD_K+ APITWOHD_K+ API
TWOHD_K+ API
 
TWOHD_Blueprint
TWOHD_BlueprintTWOHD_Blueprint
TWOHD_Blueprint
 

2009 Hackday Taiwan Yui

  • 1. Yahoo!Kimo YUI 3: Design and Architecture Thomas S. Sha YUI developer.yahoo.com/yui/
  • 2. YUI Evolved Faster, Lighter, Smarter
  • 3. YUI Evolved Architecture, Lifecycle, Packaging
  • 4.
  • 5. From YAHOO to YUI() YUI().use(“io-base”, function (Y) { var request = Y.io( ); });
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. YUI IO – Size Analysis
  • 14.
  • 15. Extensions: Class-based Flexibility Create an Overlay Class Y.Overlay = Y.Base.build(&quot;overlay&quot;, Y.Widget, [ Widget-Position, // Positioning Widget-Position-Ext, // Adv. Positioning Widget-Stack, // Shim/Stack Support Widget-StdMod // Header/Body/Footer ]);
  • 16. Extensions: Reuse Reuse only the extensions desired for Tooltip Y.Tooltip = Y.Base.build(&quot;tooltip&quot;, Y.Widget, [ Widget-Position, // Positioning Widget-Stack // Shim/Stack Support ]);
  • 17. Plug-in: Instance-based Flexibility Instance of Overlay, adding io support var ioOverlay = new Y.Overlay(...); ioOverlay.plug(Y.OverlayIOPlugin, { url: &quot;http://host.foo.com/getOverlayContent&quot; }); ioOverlay.io.refreshContent();
  • 18. Plug-in: Instance-based Override Instance of Overlay, adding Animation Support var animOverlay = new Y.Overlay(...); animOverlay.plug(Y.WidgetAnimPlugin); animOverlay.show(); animOverlay.hide();
  • 19.
  • 20. Event Façades // DOM Event linkNode.on(&quot;click&quot;, function(e) { if (!e.target.hasClass(&quot;selector&quot;)) { e.preventDefault(); } }); // Custom Event slider.on(&quot;valueChange&quot;, function(e) { if (e.newVal < 200) { e.preventDefault(); } });
  • 21. Event Aspect in YUI 2 // Publisher show : function() { if (this.fire(&quot;beforeShow&quot;)) { YAHOO.util.Dom.removeClass(node, &quot;hidden&quot;); this.fire(&quot;show&quot;); } } // Subscriber overlay.subscribe(&quot;beforeShow&quot;, function(t, args) { if (!taskSelected) { return false; } } overlay.subscribe(&quot;show&quot;, function(t, args) {...});
  • 22. Event Aspect in YUI 3 // Publisher show : function() { this.fire(&quot;show&quot;); } _defaultShowFunction : function(e) { node.removeClass(&quot;hidden&quot;); } // Subscriber overlay.on(&quot;show&quot;, function(e) { if (!taskSelected) { e.preventDefault(); } } overlay.after(&quot;show&quot;, function(e) { });
  • 23. Event Flow: On -> Default -> After ON ON Default Behavior After After After this.fire(&quot;select&quot;); e.stopImmediatePropagation() e.preventDefault() e.preventDefault() e.stopImmediatePropagation()
  • 24. Bubbling: Delegation Beyond the DOM Menu.prototype = { addItem : function(menuItem) { var menu = this; menuItem.addTarget(menu); }, initializer : function() { this.on(&quot;menuitem:select&quot;, this._itemSelect); } } menu.getItem(2).on(&quot;select&quot;, function(e) { // Handle select for item 2, don’t bubble to Menu e.stopPropagation(); ... } Event Bubbling: Delegation Beyond the DOM
  • 25. Event Flow : Bubbling Menu MenuItem ON ON Default After After After this.fire(&quot;menuitem:select&quot;); ON Default After After e.stopPropagation()
  • 26. // YUI 2 overlay.on(&quot;show&quot;, myShowHandler, myApp, true); overlay.unsubscribe(&quot;show&quot;, myShowHandler, myApp); // YUI 3 var handle = overlay.on(&quot;show&quot;, myShowHandler, myApp, true); handle.detach(); // Or overlay.on(&quot;myApp:show&quot;, myShowHandler, myApp, true); overlay.on(&quot;myApp:hide&quot;, myHideHandler, myApp, true); overlay.detach(&quot;myApp:show&quot;); overlay.detach(&quot;myApp:*&quot;); Detaching Event Listeners
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35. Node is the single point for DOM access, throughout YUI 3. Makes YUI 3 ideal as a trusted source in protected environments such as Caja and Ad-Safe. Constrained by Façades
  • 36. var items = Y.Node.all(&quot;.actions li&quot;); items.addClass(&quot;disabled&quot;); items.set(&quot;title&quot;, &quot;Item Disabled&quot;); items.each(function(node) { node.addClass(&quot;disabled); node.set(&quot;title&quot;, &quot;Item Disabled&quot;); }); NodeList: Operations a on Node Collection
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.